<?php
class Training_IndexController extends Zendvn_Controller_Action{
	
	public function request3Action(){
		echo '<br>' . __METHOD__;
		$this->_redirect('/training/index/index');
		
		$this->_helper->viewRenderer->setNoRender();
	}
	
	public function request2Action(){
		echo '<br>' . __METHOD__;
		echo '<br>' . $this->_request->getRequestUri();
		echo '<br>' . $this->_request->getBaseUrl();
		echo '<pre>';
		print_r($this->_request);
		echo '</pre>';
		
		$this->_helper->viewRenderer->setNoRender();
	}
	
	public function requestAction(){
		echo '<br>' . __METHOD__;
		echo '<br>' . $this->_request->id;
		echo '<pre>';
		print_r($this->_request->getParams());
		echo '</pre>';
		
		$this->_helper->viewRenderer->setNoRender();
	}
	
	public function indexAction(){
		echo '<br>' . __METHOD__;
		$request = $this->getRequest();
		$request = $this->_request;
		
		/*$tmp = $this->_request->getParams();
		echo '<pre>';
		print_r($tmp);
		echo '</pre>';
		$this->_request->clearParams();
		
		$tmp = $this->_request->getParams();
		echo '<pre>';
		print_r($tmp);
		echo '</pre>';*/
		
		/*echo '<br>' . $this->_request->getActionName();
		echo '<br>' . $this->_request->getControllerName();
		echo '<br>' . $this->_request->getModuleName();*/
		
		echo '<br>' . $this->_request->getParam('id',1);
	}
	
	public function viewAction(){
		echo '<br>' . __METHOD__;
		if($this->_request->isPost()){
			
			echo '<br>' . 'Da nhan duoc du lieu';
			echo '<pre>';
			print_r($this->_request->getParams());
			echo '</pre>';
			
		}else{
			
			
			echo '<br>' . 'Nhap du lieu day du vao form';
			echo '<pre>';
			print_r($this->_request->getParams());
			echo '</pre>';
			
		}
		
	}
	
	public function getAction(){
		echo '<br>' . __METHOD__;
		if($this->_request->isGet()){
			
			echo '<br>' . 'Da nhan duoc du lieu';
			echo '<pre>';
			print_r($this->_request->getParams());
			echo '</pre>';
			
		}else{
			
			
			echo '<br>' . 'Nhap du lieu day du vao form';
			echo '<pre>';
			print_r($this->_request->getParams());
			echo '</pre>';
			
		}
		
	}
	
	public function getPar(){
		$post = $_POST;
		$get = $_GET;
		$par = array_merge($post,$get);
		return  $par;
	}	
	public function addCategoryAction(){
		
	}
}